package graphic;

import game.Coordinate;
import game.Entity2D;
import game.Spawner2D;
import game.examples.newEntityCreation.ExampleTheadBased2DEntity;
import graphic.render.Render2D;

/**
 * Specializzazione della classe {@link GameView} dedicata al SinglePlayer.
 * @author Jan
 *
 */
public class SinglePlayerView extends GameView {

	private static final long serialVersionUID = -3225191352598072020L;
	
	//Di supporto
	private Spawner2D spawner;
	private Entity2D[] entities;
	
	private Entity2D userShip = new ExampleTheadBased2DEntity(1, new Coordinate(250, 250, 0), 0);

	
	public SinglePlayerView(Render2D render) {
		super(render);
			
		//TODO "costruire" la modalia'
		
	}

	@Override
	public void tick(Render2D renderScreen) {
		renderScreen.cleanRenderArea();
		entities = spawner.cloneActalEntityBuffer();
		
		for (int i = 0; i < entities.length; i++) {
			if (entities[i] != null) {
				renderScreen.centredRender( entities[i] );
			}
		}
		renderScreen.centredRender( userShip );
	}

}
